import os
import sys
# celery 根目录
CELERY_BASE_DIR = os.path.dirname(os.path.abspath(__file__))

# 把项目目录加入到导包路径
sys.path.insert(0, os.path.join(os.path.dirname(CELERY_BASE_DIR), 'LabsApp'))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'LabsApp.settings')

# 对django进行初始化
import django
django.setup()
from celery import Celery

app = Celery('shiyanlou')
app.config_from_object('celery_tasks.config')
app.autodiscover_tasks(['celery_tasks.task_email'])
# app.autodiscover_tasks(['celery_tasks.task_sms', 'celery_tasks.task_email', 'celery_tasks.task_test'])
